<template>
  <div :class="{topLevel1: topLevel === 1, topLevel2: topLevel === 2, topLevel3: topLevel === 3, topDefault: topLevel === -1}">
    <el-row>
      <el-button v-if="addShow" class="op" size="small" type="success" @click="add">添加</el-button>
      <el-button v-if="editShow" class="op" size="small" type="warning" @click="edit">修改</el-button>
      <el-button v-if="removeShow" class="op" size="small" type="danger" @click="remove">删除</el-button>
      <el-button v-if="importShow" class="op" size="small" type="primary" @click="importData">导入</el-button>
      <el-button v-if="exportShow" class="op" size="small" type="primary" @click="exportData">导出</el-button>
    </el-row>
  </div>
</template>

<script>
export default {
  name: "OperateC",
  data() {
    return {
    }
  },
  props: {
    topLevel: {
      required: false,
      default: -1,
      type: Number
    },
    add: {
      required: false,
      type: Function
    },
    edit: {
      required: false,
      type: Function
    },
    remove: {
      required: false,
      type: Function
    },
    importData: {
      required: false,
      type: Function
    },
    exportData: {
      required: false,
      type: Function
    },
    addShow: {
      required: false,
      default: false,
      type: Boolean
    },
    editShow: {
      required: false,
      default: false,
      type: Boolean
    },
    removeShow: {
      required: false,
      default: false,
      type: Boolean
    },
    importShow: {
      required: false,
      default: false,
      type: Boolean
    },
    exportShow: {
      required: false,
      default: false,
      type: Boolean
    },
  },
  methods: {
  }
}
</script>

<style scoped>
.el-row {
  text-align: left;
  padding-bottom: 5px;
}
</style>
